package cn.yunhe.test;

import cn.yunhe.entity.Printer;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
    ApplicationContext ac=null;

    @Before
    public void init(){
        ac=new ClassPathXmlApplicationContext("spring.xml");
    }

    @Test
    public void test1(){
      Printer printer= (Printer) ac.getBean("printer");
      printer.prin();



    }


}
